﻿package net.jmp0.toast.entities.effects 
{
	import flash.geom.ColorTransform;
	import net.jmp0.toast.entities.bases.GameButton;
	import punk.core.Spritemap;
	import punk.util.Input;
	
	/**
	 * ...
	 * @author Thodd
	 */
	public class GameButtonOK extends GameButton
	{
		//Embedding the button sprites
		[Embed(source = '../../res/ok.png')] private var imgOK:Class;
		private var sprOK:Spritemap = FP.getSprite(imgOK, 25, 27, false, false, 0, 0, true);

		[Embed(source = '../../res/marker/marker_small_green.png')] private var imgOKmarker:Class;
		private var sprOKmarker:Spritemap = FP.getSprite(imgOKmarker, 82, 45, false, false, 4, 3, false);

		public function GameButtonOK(x:int, y:int, callback:Function) {
			super(x, y, callback);
			this.sprite = sprOK;
			this.delay = (30 / 4);
			
			var colorT:ColorTransform = new ColorTransform();
			colorT.alphaMultiplier = 0.5;
			sprOKmarker.colorTransform(sprOKmarker.rect, colorT);
		}
		
		override public function update():void {
			super.update();
		}
			
		override public function render():void {
			updateImage(sprite.number);
			if (mouseIsOverMe) {
				drawSprite(sprOKmarker, 0, x-20, y-8, false, false);
			}
			drawSprite(sprOK, image, x, y, false, false);
		}
		
	}

}